package cn.ghb.demo.sys.user.service;

import cn.ghb.demo.common.service.CrudService;
import cn.ghb.demo.sys.user.dao.UserInfoMapper;
import cn.ghb.demo.sys.user.pojo.UserInfo;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.stereotype.Service;

/**
 * @author HongbinGao
 */
@Service
public class UserInfoService extends CrudService<UserInfoMapper, UserInfo> {

    public UserInfo getByUsername(String username) {
        QueryWrapper<UserInfo> queryWrapper = new QueryWrapper<>();
        queryWrapper.lambda().eq(UserInfo::getUsername, username);
        return getOne(queryWrapper);
    }

}
